#!/usr/bin/env node


const  //解决换行问题
  stdout = process.stdout,
  log = console.log,
  stdin = process.stdin,
  msg = ['name', 'email', 'qq', 'mobile'];

let i = 0,me = {};

stdout.write(msg[0] + ':');
stdin.on('data', data=>{
  //log(data.toString('utf8'));
  me[msg[i-1]] = data.slice(0,data.length - 1).toString('utf8');
  if(i==4){
    log(me);
    process.exit();
  }
  stdout.write(msg[i++] + ':');

  //log(data);//输入数据，输出<Buffer 对应ascll码表>
});

stdin.on('end', ()=>{
  log(me);
});


console.log('hello','world');


